<?php

define("LIBERATIONSWEB", 20091223);

session_start();

//Librairie de fonctions
require (__DIR__ . '/vendor/autoload.php');
require_once("lib/libconfig.inc.php");
require_once("lib/libsession.inc.php");
require_once("lib/libfonctions.inc.php");
require_once("lib/libmysql.inc.php");
require_once("lib/libencode.inc.php");
require_once("lib/libcourriel.inc.php");
require_once("lib/libliberations.inc.php");

if (filter_input(INPUT_POST, "prm1")!="") {
    //Début de la session
    $search = antiInjection(filter_input(INPUT_POST, "prm1"));
    if ($search != "" && $search != "-1") {
        $condition = antiInjection(filter_input(INPUT_POST, "prm1"));
    } elseif ($_SESSION["gestion_site"] != "Oui") {
        $condition = $_SESSION["employeur"];
    } else {
        $condition = "";
    }
    //Encodage des caractères
    header('Content-Type: text/html; charset=$ENCODAGE');
    unset($result2);

    $result2 = getEmployes($condition, "gestion_site", true);
    print "<option value=\"-1\">--------------------</option>";

    foreach ($result2 as $clef => $valeur) {
        print "<option value='" . $valeur["refid"] . "'>" . htmlentities($valeur["valeur"], ENT_SUBSTITUTE, "UTF-8") . "</option>";
    }
}
